<?php

$path = dirname(dirname(__FILE__));
require($path . '/config/database.php');
require($path . '/function/sqlcon.php');

$rst = new sqlcon();

//设置家电维修信息置顶失效
$rst->setSql("update electronic set istop = 0, toptype = 0, topstarttime = '', topendtime = '' where status = 1 and istop = 1 and topendtime < now()");
$rst->execute();

//设置家政服务信息置顶失效
$rst->setSql("update housecraft set istop = 0, toptype = 0, topstarttime = '', topendtime = '' where status = 1 and istop = 1 and topendtime < now()");
$rst->execute();

//设置其他服务信息置顶失效
$rst->setSql("update other set istop = 0, toptype = 0, topstarttime = '', topendtime = '' where status = 1 and istop = 1 and topendtime < now()");
$rst->execute();



//设置家电维修信息过期
$rst->setSql('update electronic set status = 4 where status = 1 and expiretime < now()');
$rst->execute();

//设置家政服务信息过期
$rst->setSql('update housecraft set status = 4 where status = 1 and expiretime < now()');
$rst->execute();

//设置其他服务信息过期
$rst->setSql('update other set status = 4 where status = 1 and expiretime < now()');
$rst->execute();



//设置首页推荐信息过期
$rst->setSql('update recommend set status = 4 where status = 1 and expiretime < now()');
$rst->execute();